<?php
class price extends goodsSaler {

    public function __construct() {
        parent::__construct();
        $this->type = G( 'a' ) == 'index' ? '' : G( 'a' );
    }

    public function index( $c, $a ) {

       $this->table = 'priceDescribe';
       $this->pk = 'goodsNo';
       $res = $this->findAll(null,null,null,3);


      include $this->display( $c ); // 加载模板

    }


    public function search_price( $c, $a ) {

        $this->table = 'priceDescribe'; // 数据库表名

        $where = array( G( 'k' ) => G( 'v' ) );
        if ( $key = G( 'key' ) ) {
            $tmp = '';
            foreach ( $where as $k => $v ) {
                $tmp .= "{$k}='" . urldecode( $v ) . "' and ";
            }
            $where = $tmp ? ( $tmp . "goodsNo ={$key} " ) : '';
        }


        $result = $this->Paged()->findAll( $where );
        $pager = $result[ 'page' ];
        $result = $result[ 'result' ];


        include $this->display( $c ); // 加载模板

    }
}


